// 导入
import { reactive, ref ,getCurrentInstance} from "vue";
// 定义表单绑定的ref
export const submitForm = ref(null);
export const currentInstance = getCurrentInstance();
// 定义初始化数据
export let loginData = reactive({
    submitForm: {
        value1:"",
        value2:"",
        value3:"abc",
        value4:"",
    },
    loginRules: {
        value1: [
            {
                required: true,
                trigger: "blur",
                message: "请输入用户名",
            },
        ],
    },
})
// 表单验证方法
// export const handleLogin = (submitForm) => {
//     console.log(currentInstance)
//     currentInstance.ctx.$refs[submitForm].validate((valid) => {
//         if (valid) {
//             console.log("验证通过");
//         } else {
//             console.log("验证失败");
//         }
//     });
// }